﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="UserEdit.aspx.cs" Inherits="ProjectSem40701.Admin.UserEdit" ValidateRequest="false" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="Telerik.Web.UI, Version=2009.1.311.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>


<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
    <title>Cập nhật thông tin thành viên</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <!--
        set tab active here
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("1"));
    </script>
    <!--
        end set tab active
     -->
    
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    
    <div id="box">
        <h3>Cập nhật thông tin thành viên</h3>
        <fieldset class="fieldset">
            <legend>
                Thông tin thành viên
            </legend>            
            
            <p>
                <label>
                    <asp:Label ID="UserName" runat="server" Text="Tên tài khoản:"></asp:Label>
                </label>
                <asp:Label ID="lblUserName" runat="server"></asp:Label>
            </p>
            
            <p>    
                <label>
                   <asp:Label ID="lblRole" runat="server" Text="Phân quyền:"></asp:Label>
                </label>
                <asp:DropDownList ID="cbbRole" runat="server" DataSourceID="ObjectDataSource1" 
                    DataTextField="RoleName" DataValueField="RoleId" Width="158px" 
                    ondatabound="cbbRole_DataBound">
                </asp:DropDownList>
            </p>
            
            <p>
                <label>
                    <asp:Label ID="lblIDCard" runat="server" Text="CMND:"></asp:Label>
                </label>
                <asp:TextBox ID="txtIDCard" runat="server" Width="150px"></asp:TextBox>
            </p>
            
            <p>
                <label>
                    <asp:Label ID="lblFName" runat="server" Text="Tên:"></asp:Label>
                </label>
                <asp:TextBox ID="txtFName" runat="server" Width="150px"></asp:TextBox>
            </p>
            
            <p>
                <label>
                    <asp:Label ID="lblLName" runat="server" Text="Họ:"></asp:Label>
                </label>
                <asp:TextBox ID="txtLName" runat="server" Width="150px"></asp:TextBox>
            </p>
            
            <p>
                <label>
                    <asp:Label ID="lblJob" runat="server" Text="Nghề nghiệp:"></asp:Label>
                </label>
                <asp:TextBox ID="txtJob" runat="server" Width="150px"></asp:TextBox>
            </p>
            
            <p>
                <label>
                    <asp:Label ID="lblGender" runat="server" Text="Giới tính:"></asp:Label>
                </label>
                <asp:DropDownList ID="cbbGender" runat="server" Width="158px">
                    <asp:ListItem Value="1">Nam</asp:ListItem>
                    <asp:ListItem Value="0">Nữ</asp:ListItem>
                </asp:DropDownList>
            </p>
            
            <p>
                <label>
                    <asp:Label ID="lblBirthDay" runat="server" Text="Ngày sinh:"></asp:Label>
                </label>
                <asp:TextBox ID="txtBirthDay" runat="server" Width="150px"></asp:TextBox>
            </p>
            <p>
                <label>
                    <asp:Label ID="lblPhone" runat="server" Text="Điện thoại:" Height="20px"></asp:Label>
                </label>
                <asp:TextBox ID="txtPhone" runat="server" Width="150px"></asp:TextBox>
            </p>
            <p style="height: auto">
                <label>
                    <asp:Label ID="lblAddress" runat="server" Text="Địa chỉ:"></asp:Label>
                </label>
                <asp:TextBox ID="txtAddress" runat="server" Width="400px" Height="40px" 
                    TextMode="MultiLine"></asp:TextBox>
            </p>
            
            <p>
                <label>
                    <asp:Label ID="lblStatus" runat="server" Text="Trạng thái:"></asp:Label>
                </label>
                <asp:DropDownList ID="cbbStatus" runat="server" Width="158px">
                    <asp:ListItem Value="1">Kích hoạt</asp:ListItem>
                    <asp:ListItem Value="0">Khóa</asp:ListItem>
                </asp:DropDownList>
            </p>
            
            <label>
                <asp:Label ID="lblDescription" runat="server" Text="Mô tả:"></asp:Label>
            </label>
            <FCKeditorV2:FCKeditor ID="txtDescription" runat="server" BasePath="../fck/" 
                Height="350px" Width="550px">
            </FCKeditorV2:FCKeditor>
                        
            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                DeleteMethod="Delete" InsertMethod="Insert" 
                OldValuesParameterFormatString="original_{0}" 
                SelectMethod="Get_Role_Select_All" 
                TypeName="ProjectSem40701.Admin.AdminXSD.RoleTableAdapters.aspnet_RolesTableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter DbType="Guid" Name="Original_ApplicationId" />
                    <asp:Parameter Name="Original_LoweredRoleName" Type="String" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter DbType="Guid" Name="RoleId" />
                    <asp:Parameter Name="RoleName" Type="String" />
                    <asp:Parameter Name="Description" Type="String" />
                    <asp:Parameter DbType="Guid" Name="Original_ApplicationId" />
                    <asp:Parameter Name="Original_LoweredRoleName" Type="String" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter DbType="Guid" Name="ApplicationId" />
                    <asp:Parameter DbType="Guid" Name="RoleId" />
                    <asp:Parameter Name="RoleName" Type="String" />
                    <asp:Parameter Name="LoweredRoleName" Type="String" />
                    <asp:Parameter Name="Description" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
        </fieldset>
        
        <div align="center">
            <asp:Button ID="btnUpdate" runat="server" Text="Cập nhật" CssClass="button" 
                onclick="btnUpdate_Click" />
            <cc1:ConfirmButtonExtender ID="btnUpdate_ConfirmButtonExtender" runat="server" 
                ConfirmText="Bạn có chắc muốn cập nhật thông tin thành viên này" Enabled="True" TargetControlID="btnUpdate">
            </cc1:ConfirmButtonExtender>
            <asp:Button ID="btnDelete" runat="server" Text="Xóa thành viên" CssClass="button" 
                onclick="btnDelete_Click" />
            <cc1:ConfirmButtonExtender ID="btnDelete_ConfirmButtonExtender" runat="server" 
                ConfirmText="Bạn có thực sự muốn xóa thành viên này?" Enabled="True" TargetControlID="btnDelete">
            </cc1:ConfirmButtonExtender>
        </div>
        
        <cc1:ModalPopupExtender ID="btnUpdate_ModalPopupExtender" runat="server" 
                        DynamicServicePath="" Enabled="False" TargetControlID="btnUpdate"
                        BackgroundCssClass="modalBackground"
                        PopupControlID="pnlPopup" >
        </cc1:ModalPopupExtender>
        
        <cc1:ModalPopupExtender ID="btnDelete_ModalPopupExtender" runat="server" 
                DynamicServicePath="" Enabled="False" TargetControlID="btnDelete"
                BackgroundCssClass="modalBackground"
                PopupControlID="pnlPopup" >
        </cc1:ModalPopupExtender>

        <asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" style="display:none;">
            <div class="inner">
                <h2>
                    <asp:Literal ID="ltrMessage" runat="server"></asp:Literal>
                </h2>
                <div class="base">
                    <asp:Label ID="lblSuccess" runat="server" Text="" Visible="false"></asp:Label>
                    <asp:Button ID="btnYes" onclick="btnYes_Click" runat="server" Text="Yes" />                            
                    <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClick="btnClose_Click"
                        OnClientClick="$find('mdlPopup').hide(); return false;" />
                </div>
            </div>
        </asp:Panel>
        
    </div>
</asp:Content>
